/**
 * 人员详情
 */
import query from '../../untils/mysql';
import { Tip } from '../../untils/untils';

const GET = async (req: any, res: any, next: any) => {
    try {
        const { userId } = req.auth;
        const data = await query(`select * from user where id = '${userId}'`);
        if (data.length === 0) {
            return Tip.tipError(res, "没有当前用户")
        }
        return Tip.tipSuccess(res, '查询成功', data[0])
    } catch (error: any) {
        Tip.tipError500(res, error)
    }
}

export {
    GET
}